//
//  HLPayRemidContentView.m
//  YueYue
//
//  Created by hulu001 on 2023/6/14.
//

#import "HLPayRemidContentView.h"
#import "M80AttributedLabel.h"
#import "HLIMKitMessageModel.h"
#import "HLPayRemindAttachment.h"

@implementation HLPayRemidContentView


- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.bubbleImageView.hidden = YES;
    
    self.backgroundColor = UIColorWhite;
    self.layer.cornerRadius = 8;
    self.layer.masksToBounds = YES;
    
    UILabel *msgLabel = [UILabel.alloc init];
    msgLabel.textAlignment = NSTextAlignmentCenter;
    msgLabel.textColor = HLTextColor1;
    msgLabel.font = UIFontMake(12);
    msgLabel.numberOfLines = 0;
    msgLabel.qmui_lineHeight = 18;
    [self addSubview:msgLabel];
    self.msgLabel = msgLabel;
    [msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(7, 10, 7, 10));
    }];
}

- (void)refreshData:(HLIMKitMessageModel *)messageModel
{
    [super refreshData:messageModel];
    
    NIMCustomObject *object = (NIMCustomObject *)messageModel.message.messageObject;
    HLPayRemindAttachment *attachment = (HLPayRemindAttachment *)object.attachment;
    
    _msgLabel.attributedText = attachment.attributedContent;
}


@end
